<template>
    <div>
        <bs4-card>
            <div slot="header" class="row">
                <div class="col-auto mr-auto">管理员管理</div>
            </div>
            <div class="row">
                <div class="col">
                    <i-form :model="model" :rules="ruleValidate">
                        <div class="row">
                            <div class="col">
                                <Form-item label="姓名" prop="name">
                                    <i-input v-model="model.name" placeholder="请输入姓名"></i-input>
                                </Form-item>
                            </div>
                            <div class="col">
                                <Form-item label="邮箱" prop="email">
                                    <i-input v-model="model.email" placeholder="请输入邮箱"></i-input>
                                </Form-item>
                            </div>
                        </div>

                        <Form-item label="电话号码" prop="mobile">
                            <i-input v-model="model.mobile" placeholder="请输入电话号码"></i-input>
                        </Form-item>

                        <Form-item label="密码" prop="password">
                            <i-input type="password" v-model="model.password" placeholder="请输入密码"></i-input>
                        </Form-item>
                    </i-form>
                </div>
            </div>
        </bs4-card>
    </div>
</template>

<script>
  import profileAPI from 'assets/js/api/admin/profile'

  export default {
    name: 'profile',
    data: function () {
      return {
        ruleValidate: {},
        model: {
          name: '',
          email: '',
          mobile: '',
          password: ''
        },
        stateManager: {
          refreshList: true,
          editDialogVisible: false,
          editModelId: 0,
          buttonLoading: false
        }
      }
    },
    methods: {
      showEditDialog: function (id) {
        this.stateManager.editDialogVisible = true
        this.stateManager.editModelId = id
      }
    },
    created () {
      let self = this
      profileAPI.getProfile((response) => {
          console.log(response)
          self.model = response.data
        }
      )
    }
  }
</script>